<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<style type="text/css">
		body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
	</style>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=CNgH95XqIkyoxdoLWWxjYiTL"></script>
	<title><?php echo "商家数量为".$amount;?></title>
</head>
<body>
	<div id="allmap"></div>
</body>
</html>
<?php 
	echo "<script type=\"text/javascript\">";
	echo "var map = new BMap.Map(\"allmap\");";
	foreach($users as $user){
		echo "var point = new BMap.Point(".$user['lng'].",".$user['lat'].");";
		echo "map.centerAndZoom(point, 12);";
		echo "map.enableScrollWheelZoom();"; //启用滚轮放大缩小，默认禁用
		echo "map.enableContinuousZoom(); ";//启用地图惯性拖拽，默认禁用
		echo "var marker = new BMap.Marker(point);";
		echo "map.addOverlay(marker);";
		echo "var label = new BMap.Label(\"".$user['shopname']." ".$user['early_time']."-".$user['late_time']."\",{offset:new BMap.Size(5,-10)});";
		echo "marker.setLabel(label);";
	}
	echo "</script>";
?>